﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Web.Script.Services;
using GandAInvitaciones.BusinessEntity;

namespace GandAInvitaciones.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IJsonService" in both code and config file together.
    [ServiceContract]
    public interface IJsonService
    {
        #region Pruebas
        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetVisitas")]
        List<Visita> GetVisitas();

        [OperationContract]
        [WebInvoke(Method = "GET",
                    ResponseFormat = WebMessageFormat.Json,
                    BodyStyle = WebMessageBodyStyle.Wrapped,
                    UriTemplate = "data/{id}")]
        JsonService.Person GetData(string id);

        [OperationContract]
        [WebInvoke(Method = "GET",
                    ResponseFormat = WebMessageFormat.Json,
                    BodyStyle = WebMessageBodyStyle.Wrapped,
                    UriTemplate = "data2/?id={id}&name={name}")]
        JsonService.Person GetData2(int id, string name);

        [OperationContract]
        [WebInvoke(Method = "POST",
                    UriTemplate = "SaveVisita",
                    BodyStyle = WebMessageBodyStyle.WrappedRequest,
                    ResponseFormat = WebMessageFormat.Json,
                    RequestFormat = WebMessageFormat.Json)]
        int SaveVisita(Visita obj);
        #endregion

        #region app
        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetCategorias")]
        List<Categoria> GetCategorias();

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetProveedores/{idCategoria}")]
        List<Proveedor> GetProveedores(string idCategoria);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetProveedor/{idProveedor}")]
        List<Proveedor> GetProveedor(string idProveedor);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "GetPromociones")]
        List<Promocion> GetPromociones();
        #endregion
    }
}
